#!/bin/bash

for FRUIT in apple banana pear; do
    echo "I like $FRUIT!"
done

#计算1到100的求和
sum=0
for i in {1..100}; do
    sum=$[$sum+$i]
done
echo "sum=" $sum

#遍历当前目录，是文件就输出xxx是一个文件，是目录就输出xxx是一个目录
for file in $(ls)
do
    if [ -f "$file" ]
    then
        echo "$file is a regular file!"
    elif [ -d "$file" ]
    then
        echo "$file is a directory!"
    else
        echo "$file is not recognized!"
    fi
done
